package com.zengyan.gd.model;


import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import lombok.Data;



/**
 *
 CREATE TABLE `organization` (
 `organization_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '组织id',
 `email` varchar(64) NOT NULL COMMENT '邮箱',
 `password` varchar(64) NOT NULL COMMENT '密码',
 `name` varchar(64) DEFAULT NULL COMMENT '组织名',
 `description` varchar(512) DEFAULT NULL COMMENT '描述',
 `ower_stu_num` varchar(64) DEFAULT NULL COMMENT '负责人的学号',
 `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
 `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
 PRIMARY KEY (`organization_id`),
 unique key `uqe_organizaton_id` (`organization_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

 *
 */
@Entity
@Data
public class Organization {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer organization_id;

    @NotEmpty(message = "邮箱必填")
    @Email
    private String email;

    @NotEmpty(message = "密码必填")
    private String password;


    private String name;
    private String description;
    private String owerStuNum;

    @Column(name = "avatar_url")
    private String avatarUrl;

    @Column(name = "bg_url")
    private String bgUrl;


}
